/*
 * @Descripttion:
 * @version:
 * @Author: kl2018
 * @Date: 2020-03-17 09:11:31
 * @LastEditors: kl2018
 * @LastEditTime: 2020-06-22 11:37:13
 */
import React, { Component } from 'react';
import { WeaLocaleProvider } from 'ecCom';
// import BaseOdocTypeComp from "./common/BaseOdocTypeComp";
import { hashHistory } from 'react-router';

const { getLabel } = WeaLocaleProvider;

class ReceiveDocManegerComp extends Component {
  constructor(props) {
    super(props);
    hashHistory.replace({
      pathname: '/main/offical/customPage',
      query: {
        customListId: -16,
        ...props.location.query,
      },
    });
  }

  render() {
    return (<span />);
    // const {location:{query}} = this.props;
    // const compProps = this.getCompProps(query);
    // return (
    //   <BaseOdocTypeComp
    //     topTitle={getLabel('387593','收文管理')}
    //     tabParams={{reqType:2}}
    //     searchParams={{officalType:2}}
    //     tableParams={{officalType:2}}
    //     {...compProps}
    //     {...this.props}
    //   />
    // )
  }

  getCompProps(query) {
    let compProps = {};
    if (query.flowtype) {
      if (query.flowtype == '0') {
        compProps.topTitle = getLabel('33787', '待办收文');
      }
      if (query.flowtype == '1') {
        compProps.topTitle = getLabel('33789', '已办收文');
      }
      if (query.flowtype == '2') {
        compProps.topTitle = getLabel('509715', '待阅收文');
      }
      if (query.flowtype == '3') {
        compProps.topTitle = getLabel('509718', '已阅收文');
      }
      if (query.flowtype == '4') {
        compProps.topTitle = getLabel('514557', '超时收文');
      }
      if (query.flowtype == '5') {
        compProps.topTitle = getLabel('514558', '在办收文');
      }
      if (query.flowtype == '6') {
        compProps.topTitle = getLabel('514559', '未办收文');
      }
      compProps.tabParams = null;
      compProps.tabUrl = null;
      compProps.tableParams = { officalType: 1, flowtype: query.flowtype };
    }
    return compProps;
  }
}

export default props => <ReceiveDocManegerComp ecId={`${this && this.props && this.props.ecId || ''}_ReceiveDocManegerComp@0dltvo`} {...props} key={props.location.query.flowtype || '-1'} />;
